/*
 * Task.h
 *
 *  Created on: Jan 13, 2010
 *      Author: artur
 */

#ifndef TASK_H_
#define TASK_H_

/*
 *
 */
#include <kiddie/kiddie.h>
#include <sys/types.h>
#include <Object.h>

#include <mem/VmMap.h>

namespace kernel
{
  namespace sys
  {
    namespace sched
    {
      namespace task
      {

        class Task : public Object
        {
        public:

          typedef enum
          {
            KERNEL = 0, SERVICE, USER
          } LEVEL;

          typedef void
          (*task_entry_t)(void *);

          Task();
          Task(Task::task_entry_t, LEVEL);
          ~Task();
          bool
          operator==(const Task &);
          bool
          operator!=(const Task &);

        public:
          task_entry_t entry;
          kernel::mem::VmMap vmap;
          struct context tsk_context;
          LEVEL pl; // privilege level

        private:
          void
          _init(void);
        };

      }
    }
  }
}

#endif /* TASK_H_ */
